package com.ruoyi.clothing.service.impl;

import java.util.HashMap;
import java.util.List;

import com.ruoyi.clothing.domain.vo.querySize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.clothing.mapper.SysCustomizationMapper;
import com.ruoyi.clothing.domain.SysCustomization;
import com.ruoyi.clothing.service.ISysCustomizationService;

/**
 * 定制管理Service业务层处理
 *
 * @author weh
 * @date 2024-01-20
 */
@Service
public class SysCustomizationServiceImpl implements ISysCustomizationService
{
    @Autowired
    private SysCustomizationMapper sysCustomizationMapper;

    /**
     * 查询定制管理
     *
     * @param id 定制管理主键
     * @return 定制管理
     */
    @Override
    public SysCustomization selectSysCustomizationById(Integer id)
    {
        return sysCustomizationMapper.selectSysCustomizationById(id);
    }

    /**
     * 查询定制管理列表
     *
     * @param sysCustomization 定制管理
     * @return 定制管理
     */
    @Override
    public List<SysCustomization> selectSysCustomizationList(SysCustomization sysCustomization)
    {
        return sysCustomizationMapper.selectSysCustomizationList(sysCustomization);
    }

    /**
     * 新增定制管理
     *
     * @param sysCustomization 定制管理
     * @return 结果
     */
    @Override
    public int insertSysCustomization(SysCustomization sysCustomization)
    {
        return sysCustomizationMapper.insertSysCustomization(sysCustomization);
    }

    /**
     * 修改定制管理
     *
     * @param sysCustomization 定制管理
     * @return 结果
     */
    @Override
    public int updateSysCustomization(SysCustomization sysCustomization)
    {
        return sysCustomizationMapper.updateSysCustomization(sysCustomization);
    }

    /**
     * 批量删除定制管理
     *
     * @param ids 需要删除的定制管理主键
     * @return 结果
     */
    @Override
    public int deleteSysCustomizationByIds(Integer[] ids)
    {
        return sysCustomizationMapper.deleteSysCustomizationByIds(ids);
    }

    /**
     * 删除定制管理信息
     *
     * @param id 定制管理主键
     * @return 结果
     */
    @Override
    public int deleteSysCustomizationById(Integer id)
    {
        return sysCustomizationMapper.deleteSysCustomizationById(id);
    }

    @Override
    public SysCustomization getNeedSize(querySize querySize) {
        Integer sex = querySize.getSex();
        Integer type = querySize.getType();
        HashMap<String , Integer> map = new HashMap<>();
        map.put("sex",sex);
        map.put("type",type);
        return sysCustomizationMapper.getNeedSize(map);
    }
}
